<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="c">aaa</div>
    <div id="c">bbbbbb</div>
    <p class="c">cccc</p>
    <h1 class="c b a">abcbaasdf</h1>
    <span data="a">123123</span>
    <span data="b">234234</span>
    <script>
        var c = document.querySelector('.c');
        var ccc  = document.querySelectorAll('.c');
        console.log(c);
        console.log(ccc);
        //  通过属性选择器获取第二个span
        var span2 = document.querySelector('span[data=b]')
    </script>
</body>

</html>